package com.fr.cell.core;

import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

public abstract class ListTableModel extends AbstractTableModel
{
  private String[] columnNames;
  private List list = new ArrayList();

  public ListTableModel()
  {
  }

  public ListTableModel(String[] paramArrayOfString)
  {
    this.columnNames = paramArrayOfString;
  }

  public void setColumn(String[] paramArrayOfString)
  {
    this.columnNames = paramArrayOfString;
  }

  public void setList(List paramList)
  {
    this.list = paramList;
  }

  public List getList()
  {
    return this.list;
  }

  public void add(Object paramObject)
  {
    this.list.add(paramObject);
  }

  public void clear()
  {
    this.list.clear();
  }

  public void removeRow(int paramInt)
  {
    if (this.list != null)
    {
      this.list.remove(paramInt);
      fireTableDataChanged();
    }
  }

  public int getColumnCount()
  {
    return ((this.columnNames == null) ? 0 : this.columnNames.length);
  }

  public int getRowCount()
  {
    return getList().size();
  }

  public String getColumnName(int paramInt)
  {
    return this.columnNames[paramInt];
  }

  public abstract Object getValueAt(int paramInt1, int paramInt2);
}